package IO;

import java.io.*;
import java.nio.charset.StandardCharsets;

/*缓冲字节流*/
public class PWDemo {
    public static void main(String[] args) throws Exception{
        /*最常用的写入字符串方式
        * 底层连接了BUfferedWriter，连接了OutputStreamWriter，连接了FileOutputStream*/
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("pw.txt"), StandardCharsets.UTF_8));
        PrintWriter pw = new PrintWriter(bw);
        pw.println("不啻微茫");
        pw.println("造炬成阳");
        System.out.println("写出完毕");
        pw.close();
    }
}
